package com.start.autumn.vaildation;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * 枚举校验器
 */
public class EnumValidator implements ConstraintValidator<EnumValid, Object> {
    private EnumValid enumValid;

    /**
     * 初始化
     * @param constraintAnnotation annotation instance for a given constraint declaration
     */
    @Override
    public void initialize(EnumValid constraintAnnotation) {
        this.enumValid = constraintAnnotation;
    }

    /**
     * 判断是否校验成功
     *
     * @param value   object to validate
     * @param context context in which the constraint is evaluated
     * @return
     */
    @Override
    public boolean isValid(Object value, ConstraintValidatorContext context) {
        return false;
    }
}
